import Vue from 'vue'
import Router from 'vue-router'
import Register from '@/components/register'
import Login from '@/components/login'
import Terms from '@/components/terms'
import Main from '@/components/main'
import ResetPassword from '@/components/resetPassword'
import ConfirmRegisterEmail from '@/components/confirmRegisterEmail'
import ConfirmEmailPassword from '@/components/confirmEmailPassword'
import Devlopment from '@/components/maincomponents/devlopment'
import DevlopmentList from '@/components/maincomponents/devlopmentList'
import Newdev from '@/components/maincomponents/newdev'
import newAgent from '@/components/agent/newAgent'
import agentDetail from '@/components/agent/agentDetail'
import conpany from '@/components/account/company'
import changePhone from '@/components/account/changePhone'
import agentList from '@/components/agent/agentList'
import main_Advertisement from '@/components/maincomponents/main_Advertisement'



// const Register = resolve => require(['../components/register'], resolve);
// const Login = resolve => require(['../components/login'], resolve);
// const Terms = resolve => require(['../components/terms'], resolve);
// const Main = resolve => require(['../components/main'], resolve);
// const ResetPassword = resolve => require(['../components/resetPassword'], resolve);
// const ConfirmRegisterEmail = resolve => require(['../components/confirmRegisterEmail'], resolve);
// const ConfirmEmailPassword = resolve => require(['../components/confirmEmailPassword'], resolve);
// const Devlopment = resolve => require(['../components/maincomponents/devlopment'], resolve);
// const DevlopmentList = resolve => require(['../components/maincomponents/devlopmentList'], resolve);
// const Newdev = resolve => require(['../components/maincomponents/newdev'], resolve);
// const newAgent = resolve => require(['../components/agent/newAgent'], resolve);
// const agentDetail = resolve => require(['../components/agent/agentDetail'], resolve);
// const conpany = resolve => require(['../components/account/company'], resolve);
// const changePhone = resolve => require(['../components/account/changePhone'], resolve);
// const agentList = resolve => require(['../components/agent/agentList'], resolve);

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Login',
      component: Login
    },
    {
      path: '/register',
      name: 'register',
      component: Register
    },
    {
      path: '/account',
      name: 'account',
      component: conpany
    },
    {
      path: '/terms',
      name: 'Terms',
      component: Terms
    },
    {
      path: '/resetPassword',
      name: 'resetPassword',
      component: ResetPassword
    },
    {
      path: '/confirmRegisterEmail',
      name: 'confirmRegisterEmail',
      component: ConfirmRegisterEmail
    },
    {
      path: '/confirmEmailPassword',
      name: 'confirmEmailPassword',
      component: ConfirmEmailPassword
    },
    {
      path: '/main',
      name: 'Main',
      component: Main,
      // redirect: '/main_Advertisement',
      redirect: '/agentList',
      children: [
        {path: '/devlopment', component: Devlopment, name: 'Devlopments', hidden: true},
        {path: '/newdev', component: Newdev, name: 'New Development'},
        {path: '/devlopmentList', component: DevlopmentList, name: 'DevlopmentList'},
        {path: '/conpany', component: conpany, name: 'conpany'},
        {path: '/changePhone', component: changePhone, name: 'changePhone'},
        {path: '/newAgent', component: newAgent, name: 'newAgent'},
        {path: '/agentList', component: agentList, name: 'agentList'},
        {path: '/agentDetail', component: agentDetail, name: 'agentDetail'},
        {path: '/main_Advertisement', component: main_Advertisement, name: 'main_Advertisement'},
      ]
    },
    {
      path: '*',
      redirect: '/'
    }
  ],
})
